import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
	path: '/',
	redirect: '/login'
},
{
	path: '/login',
	component: () => import('../views/login.vue')
},
{
	path: '/home',
	component: () => import('../views/home.vue'),
 redirect: '/welcome',
 children: [

	{
		path: '/welcome',
		component: () => import('../views/welcome.vue')
	},
	{
		path: '/users',
		component: () => import('../components/users/users.vue')
	},
	{
		path: '/roles',
		component: () => import('../components/rights/roles.vue')
	},
	{
		path: '/rights',
		component: () => import('../components/rights/rights.vue')
	},
	{
		path: '/add',
		component: () => import('../components/goods/add.vue')
	},

	{
		path: '/categories',
		component: () => import('../components/goods/categories.vue')
	},
	{
		path: '/goods',
		component: () => import('../components/goods/goods.vue')
	},
	{
		path: '/params',
		component: () => import('../components/goods/params.vue')
	},
]
},
]

const router = new VueRouter({
	routes
})


export default router
